package com.ruoyi.web.controller.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

// springboot库
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
    //配置访问电脑的资源文件
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // /images/** -- 指明访问的地址，http://ip:port/images/文件xx
        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/META-INF/resources/")
//                .addResourceLocations("file:C:\\software\\音乐\\")
//                .addResourceLocations("file:C:\\software\\springboot_project\\")
                .addResourceLocations("file:C:\\software\\JavaProjects\\");

//        .addResourceLocations("file:/root/home/image/");

//        .addResourceLocations("file:/home/fileHome/images/");

                //指定资源文件位置
//                .addResourceLocations("file:/home/lcx/myvideo");

    }

//	@Bean(initMethod="init")
//	public ZKCuratorClient zkCuratorClient() {
//		return new ZKCuratorClient();
//	}
//	
//	@Bean
//	public MiniInterceptor miniInterceptor() {
//		return new MiniInterceptor();
//	}
//
//	@Override
//	public void addInterceptors(InterceptorRegistry registry) {
//		
//		registry.addInterceptor(miniInterceptor()).addPathPatterns("/user/**")
//				       .addPathPatterns("/video/upload", "/video/uploadCover",
//				    		   			"/video/userLike", "/video/userUnLike",
//				    		   			"/video/saveComment")
//								  .addPathPatterns("/bgm/**")
//								  .excludePathPatterns("/user/queryPublisher")
//								  .excludePathPatterns("/wxLogin");
//		
//		super.addInterceptors(registry);
//	}

}
